﻿
Namespace Kategorien

    Public Class Kategorie

        Private _id As Integer
        Private _bezeichnung As String
        Private _parent As Kategorie

        Public Property Id As Integer
            Get
                Return _id
            End Get
            Set(ByVal value As Integer)
                _id = value
            End Set
        End Property

        Public Property Bezeichnung As String
            Get
                Return _bezeichnung
            End Get
            Set(ByVal value As String)
                _bezeichnung = value
            End Set
        End Property

        Public Property Parent As Kategorie
            Get
                Return _parent
            End Get
            Set(ByVal value As Kategorie)
                _parent = value
            End Set
        End Property

        Public ReadOnly Property DisplayText As String
            Get
                If _parent Is Nothing Then
                    Return _bezeichnung
                Else
                    Return String.Format("{0} # {1}", _parent.DisplayText, Bezeichnung)
                End If
            End Get
        End Property

    End Class

End Namespace